Skip to content

ci: replace tag-triggered SDK publish with release-plz#691

Merged
kvinwang merged 1 commit into
masterfrom
ci/release-plz-rust-sdk
May 19, 2026
Merged

ci: replace tag-triggered SDK publish with release-plz#691
kvinwang merged 1 commit into
masterfrom
ci/release-plz-rust-sdk

Conversation

@kvinwang
Copy link
Copy Markdown
Collaborator

@kvinwang kvinwang commented May 19, 2026

Summary

Replaces the broken tag-triggered cargo publish workflow with release-plz, a PR-driven release manager for cargo workspaces.

Why

The current rust-sdk-release.yml triggers on rust-sdk-v* tags and serially cargo publishes dstack-sdk-types then dstack-sdk. It's been awkward in practice:

  • Tag version (rust-sdk-v0.5.9) is decoupled from the actual crate version in Cargo.toml (0.1.2). The last run failed with crate dstack-sdk-types@0.1.2 already exists on crates.io index — no one had bumped Cargo.toml.
  • Two-step serial publish has no retry path: if types succeeds but sdk fails, the next attempt fails immediately on types.
  • Both crates must be kept at the same version by hand. Today there's already drift: workspace dep pin is 0.1.1 but the crate is 0.1.2.

How release-plz fixes this

  • On every push to master, opens/updates a single Release PR that bumps versions in Cargo.toml, updates workspace dependency pins, and regenerates per-crate CHANGELOG.md from commits since the last release.
  • Merging the PR auto-tags each crate (dstack-sdk-v*, dstack-sdk-types-v*), publishes to crates.io in dependency order, idempotently. Already-published versions are skipped.
  • cargo semver-checks runs automatically and warns if a change should bump major.
  • OIDC trusted publishing (id-token: write) replaces the static token flow.

Changes

  • New release-plz.toml — allowlist config: workspace default release = false, only dstack-sdk and dstack-sdk-types are managed. All other ~30 internal crates are protected from accidental publish.
  • Rewritten .github/workflows/rust-sdk-release.yml — two jobs: release-plz-pr (open/update Release PR), release-plz-release (publish on merge). Same filename and environment: sdk-release as before, so existing crates.io trusted publisher entries continue to work without changes.

First release after merge

The first push to master will open a Release PR that:

  1. Fixes the workspace dep version drift (0.1.1 → current).
  2. Bumps both crates to the next version based on commits since 0.1.2.
  3. Generates initial CHANGELOG files.

Review and merge that PR to publish.

Test plan

  • CI passes (lint, SDK tests)
  • After merge, verify Release-plz PR job runs and opens a Release PR
  • Review the first Release PR, adjust version numbers if needed, merge it
  • Verify both crates publish successfully to crates.io and tags + GitHub Releases appear

Copilot AI review requested due to automatic review settings May 19, 2026 11:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Replaces the tag-triggered, two-step cargo publish workflow for the Rust SDK crates with a release-plz–driven PR workflow. release-plz opens a Release PR on each push to master that bumps versions and updates changelogs, then on merge tags and publishes dstack-sdk-types and dstack-sdk in dependency order via OIDC trusted publishing. A new release-plz.toml allowlists only the two public SDK crates so the ~30 internal workspace members cannot be accidentally published.

Changes:

  • Add release-plz.toml with workspace.release = false and explicit release = true only for dstack-sdk and dstack-sdk-types.
  • Add .github/workflows/release-plz.yml with release-pr and release jobs (latter scoped to sdk-release environment with id-token: write for OIDC).
  • Remove the old .github/workflows/rust-sdk-release.yml.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
release-plz.toml Allowlists the two public SDK crates and disables release for all other workspace members.
.github/workflows/release-plz.yml Adds Release PR and release/publish jobs triggered on pushes to master.
.github/workflows/rust-sdk-release.yml Removes the legacy tag-triggered serial publish workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

The previous rust-sdk-release.yml triggered `cargo publish` on `rust-sdk-v*`
tags, but the tag version (e.g. rust-sdk-v0.5.9) was decoupled from the actual
crate version in Cargo.toml (0.1.2). Pushing a tag failed with "already exists
on crates.io index", and there was no way to retry once one of the two
serial publishes succeeded.

release-plz manages this end-to-end:
- on every push to master, opens/updates a single Release PR that bumps
  versions in Cargo.toml, updates workspace dependency pins, and regenerates
  per-crate CHANGELOGs based on commits since last release
- merging the PR auto-tags each crate (dstack-sdk-v*, dstack-sdk-types-v*)
  and publishes to crates.io in dependency order, idempotently
- semver-check warns if a change should bump major
- OIDC trusted publishing (id-token: write) replaces the static token flow;
  no CARGO_REGISTRY_TOKEN secret needed

release-plz.toml uses an allowlist: workspace defaults to release = false
so only dstack-sdk and dstack-sdk-types are managed; all other internal
crates are protected from accidental publish.

Follow-up: crates.io trusted publisher entries need to be re-pointed from
rust-sdk-release.yml to release-plz.yml for both crates (Settings → Trusted
Publishers on each crate's page).
@kvinwang kvinwang force-pushed the ci/release-plz-rust-sdk branch from 646223d to 45c1890 Compare May 19, 2026 11:04
@kvinwang kvinwang merged commit 356afad into master May 19, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants